package hw2.jpa.strategy;

import java.io.Serializable;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

import hw2.jpa.model.Contract;
import hw2.jpa.model.RevenueRecognition;

@Entity
@DiscriminatorValue("Complete")
public class CompleteRecognitionStrategy extends RecognitionStrategy implements
		Serializable {

	private static final long serialVersionUID = 1L;

	@Override
	public void calculateRevenueRecognitions(Contract contract) {
		contract.addRevenueRecognition(new RevenueRecognition(contract
				.getRevenue(), contract.getWhenSigned()));
	}
}
